package com.ht.service.impl;

import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.ht.dao.StaffDAO;
import com.ht.dao.impl.StaffDAOImpl;
import com.ht.service.LoginService;


public class LoginServiceImpl implements LoginService {
	
	private StaffDAOImpl staffDAO = new StaffDAOImpl();
	
	public boolean isLogin(String staffName, String staffPsw) {
		String queryString ="select * from Staff as model where model.staffName='"+staffName+"' and model.staffPsw='"+staffPsw+"'";
		return staffDAO.findStaff(queryString).size()==1?true:false;
	}
	
	public StaffDAO getStaffDAO() {
		return staffDAO;
	}
	public void setStaffDAO(StaffDAOImpl staffDAO) {
		this.staffDAO = staffDAO;
	}

}
